import request from '@/utils/request'

// 查询题目表列表
export function listQuestion(query) {
    return request({
        url: '/ex/question/list',
        method: 'get',
        params: query
    })
}

// 刷新缓存
export function flush_cache() {
    return request({
        url: '/ex/question/flush-cache',
        method: 'get'
    })
}

// 根据范畴为题目分组，获取每个范畴的题目数量
export function get_question_ids_group_by_topic() {
    return request({
        url: '/ex/question/get-question-ids-group-by-topic',
        method: 'get'
    })
}

// 查询题目表详细
export function getQuestion(id) {
    return request({
        url: '/ex/question/' + id,
        method: 'get'
    })
}

// 新增题目表
export function addQuestion(data) {
    return request({
        url: '/ex/question',
        method: 'post',
        data: data
    })
}

// 修改题目表
export function updateQuestion(data) {
    return request({
        url: '/ex/question',
        method: 'put',
        data: data
    })
}

// 删除题目表
export function delQuestion(id) {
    return request({
        url: '/ex/question/' + id,
        method: 'delete'
    })
}
